package com.itany.corejava.code07_面向对象.租车系统;

/**
 * @author MissChen
 * @version 1.0
 * @date 2023 年11月06日 16:21
 */
public class Car extends  MotorVehicle{
    private String type;

    public Car(String no, String brand, String type) {
        super(no, brand);
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }



    @Override
    public double rent(int day) {
        double sum=0;//租金的总金额
        if(type.equals(CarConstant.BMW_X1)){
            sum=200*day;
        }else if(type.equals(CarConstant.BENZ_GLC)){
            sum=300*day;
        }else if(type.equals(CarConstant.PORSCHE_PARAMERA)){
            sum=800*day;
        }else if(type.equals(CarConstant.ROLLS_ROYCE)){
            sum=2000*day;
        }
        return sum;
    }
}
